package com.lc.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Author:LiChuang
 * Date: 2022/8/4 16:07
 */
@Configuration
public class RouteConfig {

    /**
     *代码路由，与yml路由不冲突
     */
    @Bean
    public RouteLocator getRouteLocator(RouteLocatorBuilder builder){
        return builder.routes()
                .route("test_route", r -> r.path("/get").uri("http://XXX.com"))
                .build();
    }
}
